package com.leetcode.problems100;


import com.leetcode.util.TreeNode;

/**
 * https://leetcode-cn.com/problems/same-tree/
 * @Date 2021/11/20 14:34
 * @Author ghery
 * @Version V1.0
 */
public class Solution {


    public boolean isSameTree(TreeNode p, TreeNode q) {
        if(p == q){
            return true;
        }
        if(p == null || q == null || p.val != q.val){
            return false;
        }

        return isSameTree(p.left,q.left) && isSameTree(p.right,q.right);

    }
    public static void main(String[] args) {
        System.out.println();
    }
}
